package com.ptit.piclient;

import java.util.ArrayList;

import com.ptit.piclient.model.Song;
import com.ptit.piclient.tools.AllSongAdapter;
import com.ptit.piclient.tools.PiConnector;

import ptit.androidplayer.R;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class AllSongActivity extends Activity implements OnItemClickListener {
	ListView lv ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_song_list);
		lv = (ListView) findViewById(R.id.allSong);
		ArrayList<Song> list = PiConnector.getInstance().getAllSongs();
		AllSongAdapter adapter = new AllSongAdapter(this, list);
		lv.setAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		// TODO Auto-generated method stub
		
	}

}